let reply = (ctx, err, callback) => {

    if (err) {
        ctx.json({
            code: 1,
            msg: err,
            data: ''
        });
    } else {
        let result = {
            code: 0,
            msg: '',
            data: ''
        };
        if (!callback) {
            ctx.json(result);
            return
        }
        callback(ctx, result);
    }

};

module.exports = reply;
